Check point framework to trace the program from the coding


The checkpoint framework is the easy to use tool which allows verifying assumptions in the code and diagnosing issues from a single cockpit using the breakpoint, assertions, and log variables during runtime for further analysis. Using the demo program DEMO_CHECKPOINTS let's try to get acquainted with it.

A checkpoint is one of three ABAP statements: BREAK-POINT, LOG-POINT and ASSERT. Each of these statements can be attached to a checkpoint group using the ID <group_name> extra.

BREAK-POINT

Leveraging breakpoints as part of a checkpoint group can be useful because we can switch them on and off  by changing the configuration in the checkpoint group.



LOG-POINT
Log points are used to record the contents of data variables at runtime into a checkpoint group’s output log. Log points allow reviewing the contents of data variables without using the debugger. Log points are intended to be used for testing purposes in transaction SAAB.

ASSERT

The ASSERT statement is used to verify that a logical expression is true. If the logical expression is false, the ASSERT triggers behavior based on how it’s configured in the checkpoint group.  When attached to a checkpoint group, we can control whether the ASSERT statement creates a log entry (like a LOG-POINT), functions as a BREAK-POINT, or causes a system short dump.

Implementation 

PARAMETERS: subkey TYPE c LENGTH 30 LOWER CASE DEFAULT sy-uname,
            field1 TYPE c LENGTH 10 LOWER CASE DEFAULT 'Field1',
            field2 TYPE i DEFAULT 0.

CLASS demo DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main.
ENDCLASS.

CLASS demo IMPLEMENTATION.
  METHOD main.

    LOG-POINT ID demo_checkpoint_group
                 SUBKEY subkey
                 FIELDS field1 field2.

    BREAK-POINT ID demo_checkpoint_group.

    ASSERT ID demo_checkpoint_group
              CONDITION field2 IS NOT INITIAL.

  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  demo=>main( ).

Checking group

The checkpoint group can be accessed by the transaction SAAB. This can be set globally, personally of for a group of users during a period of time. 





Comments